package com.ygo.feihua.view;
import android.support.v7.widget.*;
import android.app.*;
import android.view.*;
import com.ygo.feihua.*;
import android.widget.LinearLayout;
import android.content.*;
import android.util.*;
import android.graphics.*;

public class OurBar extends Toolbar
{
	private Menu menu;
	LinearLayout ot_left_layout,ot_center_layout,ot_right_layout;
	
	public OurBar(android.content.Context context) {
		super(context);
		
	}
	public OurBar(Context context, AttributeSet attrs) {
        this(context, attrs, 0);

    }

    public OurBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
		
		removeAllViews();

		setBackgroundColor(Color.parseColor("#ECECF1"));
		View view=LayoutInflater.from(context).inflate(R.layout.ourbar,this,false);
		
		
		ot_left_layout=(LinearLayout) view.findViewById(R.id.ot_left_layout);
		ot_center_layout=(LinearLayout) view.findViewById(R.id.ot_center_layout);
		ot_right_layout=(LinearLayout) view.findViewById(R.id.ot_right_layout);


		ot_right_layout.setOrientation(LinearLayout.HORIZONTAL);

		/*for(int i=0;i<menu.size();i++){
			ot_right_layout.addView(menu.getItem(i).getActionView());
		}*/
		addView(view);
		
		
	}
	
	public void initMenu(){
		menu=getMenu();
		Log.e("总数","总数为"+menu.size());
		for(int i=0;i<menu.size();i++){
			ot_right_layout.addView(menu.getItem(i).getActionView());
		}
		
		
	}
	
}
